package cn.edu.wfu.libautobook.service.impl;

import cn.edu.wfu.libautobook.bean.User;
import cn.edu.wfu.libautobook.mapper.UserMapper;
import cn.edu.wfu.libautobook.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public User getUserByUid(int uid) {
        return userMapper.selectById(uid);
    }

    @Override
    public int register(User user) {
        return userMapper.insert(user);
    }

    @Override
    public User getUserByUsername(String username) {
        return userMapper.queryUserByUsername(username);
    }
}
